package com.opo5.logisticsmanagement.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.opo5.logisticsmanagement.Vo.SpareVo;
import com.opo5.logisticsmanagement.Vo.StatisUserVo;
import com.opo5.logisticsmanagement.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author lixin
* @description 针对表【tbs_user】的数据库操作Mapper
* @createDate 2022-07-10 08:55:41
* @Entity generator.domain.User
*/
@Mapper
public interface UserDao extends BaseMapper<User> {
    @Select("SELECT u.nickname,MONTH(d.date) AS mon,COUNT(*)\n" +
            "\tFROM tbs_user u \n" +
            "\tJOIN \n" +
            "\ttbs_user_date ud\n" +
            "\tON u.id=ud.user_id\n" +
            "\tJOIN\n" +
            "\ttbs_date d \n" +
            "\tON d.id=ud.date_id\n" +
            "\tWHERE \n" +
            "\tYEAR(d.date)=2022\n" +
            "\tGROUP BY u.nickname,MONTH(d.date)")
    Page<StatisUserVo> user(Page<StatisUserVo> iPage);
}




